import React, { useEffect } from 'react';
import { useSelector } from 'react-redux';
import { useParams } from 'react-router-dom';
import { useUser } from '../../store/actions/index'


const User = function () {
    const { loginname } = useParams();
    // console.log(loginname);
    let { data, loading } = useSelector(state => state.user)
    const getData = useUser();
    useEffect(() => {
        getData(loginname)
    }, [])
    return (
        <>
            {data.avatar_url ? (<img alt="" src={data.avatar_url}></img>) : ''}
        </>
    )
}

export default User;